/*
 * This is written by Lulu Han.
 * E-mail: locomotive_crypto@163.com
 */

// Secure Unequal to Zero Test
#ifndef PPSPD_SUEZ_H
#define PPSPD_SUEZ_H

#include "sec_set.h"

class SecUez{
public:
	class CloudA{
	public:
		CloudA(const PrivateKey& pri);
	
		void set_vlen(long vlens);
		void dec_reenc(const NTL::ZZ& nca, const NTL::ZZ& ncb, NTL::ZZ& cmul);
		void dec_gen_beta(const NTL::ZZ& ct, NTL::ZZ& cbeta);
		
	private:
		SecSet::CloudA m_setA;
	};
	
	class CloudB{
	public:
		CloudB(const PublicKey& pub);
		
		void set_vlen(long vlens);
		
		void calc_sub(const NTL::ZZ& cx);
		void gen_two_ciphers(NTL::ZZ& nca, NTL::ZZ& ncb);
		void calc_expr(const NTL::ZZ& cmul, NTL::ZZ& ct);
		void gen_res(const NTL::ZZ& cbeta, NTL::ZZ& res);
		
	private:
		Encryptor m_enc;
		SecSet::CloudB m_setB;
	};
};

#endif // PPSPD_SUEZ_H
